home *** CD-ROM | disk | FTP | other *** search
- (***********************************)
- (* TWINS Version 1.01 *)
- (***********************************)
- (* Object -Oriented Windows *)
- (* for Turbo Pascal Version 5.5 *)
- (* Copyright 1990 *)
- (* Brian Corll *)
- (* All Rights Reserved *)
- (***********************************)
- (***********************************)
- (* Turbo Pascal is a registered *)
- (* trademark of Borland Int. Corp. *)
- (***********************************)
- (* Portions Copyright 1984,1989 *)
- (* Borland International Corp. *)
- (***********************************)
- (***********************************)
-
- UNIT WINDOWS;
-
- INTERFACE
-
- Uses Screens;
-
- CONST
- MaxWins = 255;
- Shadow = TRUE;
- NoShadow = FALSE;
-
-
- { These window borders are defined in SCREENS.PAS:
- SolidBrdr : Borders = '██████';
- SingleBrdr : Borders = '┌└┐┘─│';
- DoubleBrdr : Borders = '╔╚╗╝═║';
- Stars : Borders = '******';
- QuarterTone : Borders = '░░░░░░';
- HalfTone : Borders = '▒▒▒▒▒▒';}
-
- TYPE
- Result = (Success,Failure);
- Positions = (Left,Right,Center);
- Str80 = String[80];
-
- WindowPtr = ^WindowObject;
- (* Pointer to window object *)
- WindowObject = OBJECT
- WSRow,WERow,WSCol,WECol : BYTE;
- (* Starting and ending rows and columns of window *)
-
- WinBuf : POINTER;
- (* Pointer to screen save buffer *)
-
- WFAttr,WBAttr : BYTE;
- (* Foreground and background attributes *)
-
- WinFill : CHAR;
- (* Window fill character *)
-
- WinFrame : Borders;
- (* Window frame *)
-
- WinTitle : Str80;
- (* Window title *)
-
- WinTitlePos : Positions;
- (* Window title position *)
-
- ShadowOn : BOOLEAN;
- (* Turns shadows on/off *)
-
- Active : BOOLEAN;
- (* Stores active/inactive status of window *)
-
- PROCEDURE SaveWin;
- (* Save a screen region to a buffer *)
-
- PROCEDURE RestWin;
- (* Restore a screen region from a buffer *)
-
- PROCEDURE MakeWin(SRow,SCol,ERow,ECol,FAttr,BAttr : BYTE;
- Frame : Borders;FillChar : CHAR;Shadow : BOOLEAN);
- (* Create a window *)
-
- PROCEDURE RemoveWin;
- (* Remove a window *)
-
- PROCEDURE FillWin(FillChar : CHAR);
- (* Fill a window with a specified character *)
-
- PROCEDURE ChFrameAttr(NewAttr : BYTE);
- (* Change window frame attribute *)
-
- PROCEDURE ChFrame(NewFrame : Borders);
- (* Change frame style *)
-
- PROCEDURE WriteWin(WRow,WCol : BYTE;WriteStr : String);
- (* Write a string in a window *)
-
- PROCEDURE WriteWinC(WRow : BYTE;WriteStr : String);
- (* Write a string in a window, centered *)
-
- PROCEDURE TitleWin(Where : Positions;Title : Str80);
- (* Title a window *)
-
- PROCEDURE ScrollWin(NumLines : BYTE;WhichWay : Direction);
- (* Scroll window contents NumLines lines up or down *)
-
- PROCEDURE ClearWin;
- (* Clear window *)
-
- PROCEDURE MoveWin(NewSRow,NewSCol : BYTE);
- (* Move window to new row and column *)
-
- CONSTRUCTOR Init;
- (* Initialize an object instance *)
-
- DESTRUCTOR Done;
- (* Destroy an object instance *)
-
- END;
-
- VAR
- ShadowColor : BYTE;
- LastWindow : BYTE;
- WOk : Result;
-
- PROCEDURE WFill(Row,Col,Rows,Cols,Attr : Byte;Ch : Char);
- (* Fill a screen region with a specified color and attribute *)